package com.diandian.backend.entrance.client;

import com.diandian.backend.entrance.client.dto.ElemeRetailSkuStockUpdateOneReq;
import com.diandian.backend.entrance.client.dto.eleme.GetSkuStockReqDTO;
import com.diandian.base.boot.starter.response.BaseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient("eleme-retail-exchange")
//@FeignClient(value = "business-eleme-retail-exchange", url = "http://localhost:10001", path = "")
public interface DianDianElemeRetailExchangeClient {

    @PostMapping("/business/sku/stock/manage/skuStockUpdateOne")
    BaseResult skuStockUpdateOne(@RequestHeader(value = "source") String source,
                                 @RequestHeader(value = "secret") String secret,
                                 @RequestBody ElemeRetailSkuStockUpdateOneReq data) throws Exception;

    /**
     * 查询商品库存数据（基于：商品列表）
     *
     * @return
     * @throws Exception
     */
    @PostMapping("/business/sku/stock/manage/get")
    BaseResult getSkuStock(@RequestHeader(value = "source") String source,
                                  @RequestHeader(value = "secret") String secret,
                                  @RequestBody GetSkuStockReqDTO data);

}
